package com.toocms.jinjuhang.data.goods

data class CommodityItemData(
    val goods_id: String?,
    val goods_name: String?,
    val goods_type: String?,
    val cover: String?,
    val cover_path: String?,
    val stock: String?,
    val goods_prop: String?,
    val price: String?,
    val points: String?,
    val sales: String?,
    val sellout_cover: String?,
    val pendant: String?,
    val zone_id: String?,
    val show_sales: String?,
    val is_on_sale: String?,
    val is_new: String?,
    //TODO 救助字段
    val rescue_id: String?,
    val rescue_name: String?
) {
    val _id: String
        get() {
            return if (!goods_id.isNullOrEmpty()) {
                goods_id
            } else if (!rescue_id.isNullOrEmpty()) {
                rescue_id
            } else {
                ""
            }
        }
    val _name: String
        get() {
            return if (!goods_name.isNullOrEmpty()) {
                goods_name
            } else if (!rescue_name.isNullOrEmpty()) {
                rescue_name
            } else {
                ""
            }
        }

    val _price: String?
        get() {
            return price?:"0"
        }

}